//npm install mysql
const mysql = require("mysql");

//创建数据库连接
let con = mysql.createConnection({
    host: "192.168.174.166",
    user: "root",
    password: "ddd",
    database: "informationsys"
})

let userName = process.argv[2];
let userAge = process.argv[3];

let sql = "update users set user_age=? where user_name=?";

con.query(sql, [userAge, userName], (err, results, fields) => {
    if (err) {
        console.log(err)
    }
    else {
        console.log(results)
    }
})